<template>
	<view :style="{'background-color':pageBg}" style="float: left;width: 100%;min-height: 100%;">
		<smh-timer ref="timer" @timing="timing" :auto="false"></smh-timer>
		<button @click="start">开始</button>
		<button @click="clear">停止</button>
		<button @click="reset">重置</button>
	</view>
</template>
<script>
	var _self;
	import dayjs from '@/dayjs.min.js'
	export default {
		components: {
		},
		watch: {

		},
		data() {
			return {
				globalUrl: getApp().globalData.url,
				 
			};
		},
		destroyed() {
			
		},
		onShow() {
			uni.getStorage({
				key: 'user',
				success: function(res) {
					if (res.data) {
						// _self.user = res.data
					}
				},
				fail: function(e) {
					uni.navigateTo({
						url: '../login/login'
					});
				}
			})
		},
		onLoad(options) {

			
		},
		methods: {
			  timing(second){
			         //实时返回计时时间
			         console.log(second)
			     },
			     reset(){
			         //重置计时器
			         this.$refs.timer.reset()
			     },
			     start(){
			         //手动开启计时器
			         this.$refs.timer.start()
			     },
			     clear(){
			         //停止计时器
			         this.$refs.timer.clear()
			     },
		}
	};
</script>

<style lang="scss" scoped>
	page {
		height: 100%;
		width: 100%;
		margin: 0;
		background-color: $page-bg !important;
	}

	.css-theme {
		@include text-color();
		@include base-background();
		@include border-color();
		@include shadow-color();
	}

   
</style>